// https://vuex.vuejs.org/zh-cn/intro.html
// make sure to call Vue.use(Vuex) if using a module system
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    userId: '',
    userInfo: {},
    openId: '',
    phoneNumber: ''
  },
  mutations: {
    updateUserId (state, data) {
      this.state.userId = data
    },
    updateUserInfo (state, data) {
      this.state.userInfo = data
    },
    updateOpenId (state, data) {
      this.state.openId = data
    },
    updatePhoneNumber (state, data) {
      this.state.phoneNumber = data
    }
  }
})

export default store
